package com.example.statistics.controller;

import com.example.client.order.OrderFeignClient;
import com.example.common.util.constant.Constants;
import com.example.common.util.core.controller.BaseController;
import com.example.common.util.core.resultbody.AjaxResult;
import com.example.model.vo.order.OrderCountQueryVo;
import com.example.service.util.conversion.FeignResultConversion;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @Author juzipi
 * @Date 2021/7/30 17:12
 * @Info
 */
@Api(tags = "统计")
@RestController
@RequestMapping("admin/statistics/statistics")
public class StatisticsController extends BaseController {


    @Autowired
    private OrderFeignClient orderFeignClient;



    @ApiOperation("预约数据统计")
    @GetMapping("get")
    public AjaxResult getOrderCountMap(OrderCountQueryVo orderCountQueryVo){
        Object object = orderFeignClient.getOrderInfoCountMap(orderCountQueryVo).get(Constants.DATA);
        HashMap<String,Object> hashMap = FeignResultConversion.convertResult(object, HashMap.class);
        return AjaxResult.success(hashMap);
    }




}
